package com.testing.class11;

import com.testing.app.AppKeyword;

/**
 * @Classname StartFromAppH5
 * @Description 类型说明
 * @Date 2022/10/28 21:33
 * @Created by 特斯汀Roy
 */
public class StartFromAppH5 {
    public static void main(String[] args) {
        AppKeyword app = new AppKeyword();
        app.startAppiumServer("12345");
        //启动的时候以NATIVE形式进行启动。
        app.startApp("12345", "com.android.browser", ".BrowserActivity", "");
        app.click("//*[@resource-id='com.android.browser:id/url']");
        app.input("//*[@resource-id='com.android.browser:id/url']", "https://ke.qq.com");
        app.halt("3");
        app.adbEnter();
        app.clickUnSure("//*[@text='一键领取']/../../following-sibling::*");
        app.clickUnSure("//*[@text='资源位弹窗']/following-sibling::*");

        //切换到webview模式来进行测试
        System.out.println(app.getDriver().getContextHandles());
        app.getDriver().context("WEBVIEW_com.android.browser");
        app.input("//input[@type=\"search\"]", "特斯汀");

    }
}
